labels = ['bicycle', 'aeroplane', 'bottle', 'dog', 'tvmonitor', 'sofa', 'diningtable', 'horse',
          'motorbike', 'sheep', 'bus', 'boat', 'person', 'cat', 'train', 'chair', 'car', 'pottedplant', 'cow', 'bird']


def encoding(name):
    for i, label in enumerate(labels):
        if name == label:
            return i

    return len(labels)


if __name__ == '__main__':
    print(encoding(None))